package com.biaobiaoqi.scoreanalysis.administrator.action;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.service.IClazzService;
import com.biaobiaoqi.scoreanalysis.util.SchoolType;
import com.opensymphony.xwork2.ActionSupport;

public class AddClazz extends ActionSupport {
	private static final Log log = LogFactory.getLog(AddClazz.class);
	private static final long serialVersionUID = -6189670967369470460L;
	private int startNum;
	private int endNum;
	private int schoolYear;
	private int clazzType;
	private SchoolType schoolType;
	@Resource
	IClazzService clazzService;

	public String execute() {
		log.debug("startNum:" + startNum + " endNum:" + endNum + " schoolYear:"
				+ schoolYear + " clazzType:" + clazzType+" schoolType: ");
		System.out.println("startNum:" + startNum + " endNum:" + endNum + " schoolYear:"
				+ schoolYear + " clazzType:" + clazzType+" schoolType: ");
		
 			for (int i = startNum; i <= endNum; i++) {
				clazzService.addClazz(i, schoolYear, clazzType, schoolType);
			}
			return SUCCESS;
 	}

	public int getStartNum() {
		return startNum;
	}

	public void setStartNum(int startNum) {
		this.startNum = startNum;
	}

	public int getEndNum() {
		return endNum;
	}

	public void setEndNum(int endNum) {
		this.endNum = endNum;
	}

	public int getSchoolYear() {
		return schoolYear;
	}

	public void setSchoolYear(int schoolYear) {
		this.schoolYear = schoolYear;
	}

	public int getClazzType() {
		return clazzType;
	}

	public void setClazzType(int clazzType) {
		this.clazzType = clazzType;
	}

	public IClazzService getClazzService() {
		return clazzService;
	}

	public void setClazzService(IClazzService clazzService) {
		this.clazzService = clazzService;
	}

	public SchoolType getSchoolType() {
		return schoolType;
	}

	public void setSchoolType(SchoolType schoolType) {
		this.schoolType = schoolType;
	}

}
